<?php
	$topic_id = $params[0];
	list($sql,$all_page) = splitPage("`tbl_webboard_reply` AS `r` LEFT JOIN `tbl_member` AS `m` ON `r`.`member_id` = `m`.`member_id` "," `r`.`topic_id` = '$topic_id' AND `r`.`status` != '2' ORDER BY `r`.`reply_id` ASC", 30, $_GET['p'],"`r`.*, `m`.`username`");
	$strPage = fetchPage($all_page,$_GET['p']);
	$query = mysql_query($sql);
	$tp->block('result');
	while($result = mysql_fetch_assoc($query)) {
		$reply_id	= $result['reply_id'];
		$title		= $result['detail'];
		$username	= $result['username'];
		$status		= $result['status'] ? 'publish' : 'draft';
		$date		= formatDate($result['date'], 'd/m/Y');
		$update		= formatDate($result['update'], 'd/m/Y');
		$tp->apply();
	}
	mysql_free_result($query);
?>